using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

using Sunyi.Project.WebPoint.DataContract;

namespace ActivitySystem.DataContract
{
    [Serializable]
    public partial class Activity : IDataEntity
    {
        #region Property

        public Guid Id
        {
            get;
            set;
        }

        public string Title
        {
            get;
            set;
        }

        public Guid LauncherId
        {
            get;
            set;
        }

        public bool IsPublic
        {
            get;
            set;
        }

        public bool IsApproved
        {
            get;
            set;
        }

        public DateTime StartTime
        {
            get;
            set;
        }

        public DateTime EndTime
        {
            get;
            set;
        }

        public string Description
        {
            get;
            set;
        }

        public bool IsActive
        {
            get;
            set;
        }

        public DateTime InsertTimeStamp
        {
            get;
            set;
        }

        public DateTime UpdateTimeStamp
        {
            get;
            set;
        }

        private Collection<Guid> participations = new Collection<Guid>();
        public Collection<Guid> Participations
        {
            get
            {
                return participations;
            }
        }

        private Collection<Guid> activityTypes = new Collection<Guid>();
        public Collection<Guid> ActivityTypes
        {
            get
            {
                return activityTypes;
            }
        }

        #endregion

        #region Override Method

        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            if (obj.GetType() != typeof(Activity)) return false;

            return this.Id == ((Activity)obj).Id;
        }

        public override int GetHashCode()
        {
            return this.Id.GetHashCode();
        }

        #endregion
    }
}
